<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta name="renderer" content="webkit">
        <title>个人信息</title>
        <link rel="stylesheet" href="/css/pintuer.css">
        <link rel="stylesheet" href="/css/admin.css">
        <script src="/js/jquery.js"></script>
        <script src="/js/pintuer.js"></script>
        <script src="/js/vue.js"></script>
        <script src="/js/axios.min.js"></script>
    </head>
    <body>
        <div class="panel admin-panel" id="info">
            <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 个人信息</strong></div>
            <div class="body-content">
                <form method="post" class="form-x" action="">
                    <div class="form-group">
                        <div class="label">
                            <label>姓名：</label>
                        </div>
                        <span class="radio">{{adminInfo.adminName}}</span>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>性别：</label>
                        </div>
                        <div class="field">
                            <div class="controls">
                                <label data-toggle="radio" class="radio">
                                    <span>{{adminInfo.adminSex}}</span>
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>年龄：</label>
                        </div>
                        <span class="radio">{{adminInfo.adminAge}}</span>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label></label>
                        </div>
                        <div class="field">
                            <a  href="/backStage/updateinfo"class="button bg-main icon-check-square-o" type="submit">
                                 修改
                            </a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <script>
            var vue = new Vue({
                el:"#info",
                data:{
                    adminId: "",
                    adminInfo:{}
                },
                methods:{
                    showId: function () {
                        let url = "/admin/showName";
                        axios.get(url)
                            .then(function (result) {
                                let adminId = result.data.adminId;
                                this.vue.adminId = adminId;
                                this.vue.showInfo();
                            })
                            .catch();
                    },
                    showInfo:function () {
                        let url = "/admin/showInfo?adminId="+this.adminId;
                        axios.get(url)
                            .then(function (result) {
                                this.vue.adminInfo = result.data;
                            })
                            .catch();
                        },
                    },
                mounted:function () {
                    this.showId();
                }
            })
        </script>
    </body>
</html>